"use strict";

var C = require('../lib/common'),
    path = require('path');

module.exports = function (engine, attributes, content, next) {

    var testFiles = engine.parseValue(attributes.test);
    var files = testFiles.split(',');

    files = C._.map(files, function (file) { return path.resolve(engine.modulePath, file); });

    var reporter = require('nodeunit').reporters.default;

    reporter.run(files, null, function(err) {
        if (err) return next(err);

        next();
    });
};